#ifndef MAININTERFACE_H
#define MAININTERFACE_H

#include <MainWindow.h>
#include <QDialog>

namespace Ui {
class MainInterface;
}

class MainInterface : public QDialog
{
    Q_OBJECT

public:
    explicit MainInterface(QWidget *parent = nullptr);
    ~MainInterface();
    void setPixmap(const QPixmap& pixmap);

private:
    void ChangeStyle(QPushButton *qpb, int indexes);

protected:
    bool eventFilter(QObject * watched, QEvent * event) override;

private slots:
    void on_chat_clicked();//切换聊天界面
    void on_contacts_clicked();//切换联系人界面
    void on_collect_clicked();//切换收藏界面
    void on_search_clicked();//搜索
    void slot_search_user(int uid);//显示搜索到的用户
    void on_logOutBtn_clicked();//退出登录
    void on_aiBtn_clicked();

    void on_groupBtn_clicked();

signals:
    void sig_exit_chat();

private:
    Ui::MainInterface *ui;
    MainWindow *_parentWindow;
    QPushButton *_display;
    short _currentPage{0};
    QTimer *heartbeat{nullptr};
};

#endif // MAININTERFACE_H
